test(coding-agent): align onboarding red-team with discovery error contract - #3966
Conversation
…ntract Dev CI at 4f6e860 fails provider-onboarding-wizard-redteam on a stale assertion: it expected "At least one model id is required" while addApiCompatibleProvider throws the post-#3927 public message "At least one model id or model discovery is required." Update the empty-models red-team expectation to the exact intended substring of that contract. No runtime change. Lore-id: 9c4e1a02 Confidence: high Scope-risk: narrow Reversibility: trivial Tested: bun test packages/coding-agent/test/provider-onboarding-wizard-redteam.test.ts (7 pass / 0 fail) Not-tested: full Dev CI shard matrix
Yeachan-Heo
left a comment
There was a problem hiding this comment.
Red-team review — MERGE_READY / CLEAR
Exact head: 23849a8503e24b334c90c92245ab17e275a6e67e
Base: dev @ 4f6e860d7
CI: Dev CI run 31127515306 — success (23 success / 5 skipped / 0 failure)
Scope
| Surface | Result |
|---|---|
| Files | 1 only — packages/coding-agent/test/provider-onboarding-wizard-redteam.test.ts |
| Production / runtime | None |
| Change | One assertion: stale "At least one model id is required" → intended public substring "At least one model id or model discovery is required" |
Contract
Matches production provider-onboarding.ts:249:
throw new Error("At least one model id or model discovery is required.");
Empty model list after whitespace/comma parsing still rejects when discovery is absent; the public message correctly names discovery as the alternate path. Test uses established toThrow substring style (same as sibling "Provider id is required").
Regression risk
| Risk | Verdict |
|---|---|
| Runtime behavior change | No |
| Weakens validation | No — still asserts rejection for empty models |
| Unrelated ACP/session | No |
Local verification
bun test packages/coding-agent/test/provider-onboarding-wizard-redteam.test.ts → 7 pass / 0 fail (reproduced stale failure first on 4f6e860).
Verdict
MERGE_READY / CLEAR. Remaining #3927 provider baseline test-oracle fix.
— census red-team @ emergency audit batch
Problem
Dev CI at
4f6e860fails only onprovider-onboarding-wizard-redteamwith a stale expected string after #3927:At least one model id is requiredAt least one model id or model discovery is required.Production (
provider-onboarding.ts:249) correctly allows empty model lists when discovery is configured.Fix
One-line test update in
packages/coding-agent/test/provider-onboarding-wizard-redteam.test.tsto match the exact intended public error substring.Non-goals
Verification